package com.spring.eurekapost;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
public class PostController {

    @Autowired
    EurekaClientService eurekaClientService;


    @Autowired
    RestTemplate restTemplate;

    @GetMapping("/testFeign")
    public Object testApi() {
        List<User> list=eurekaClientService.getUserList();
        return list;
    }


    @GetMapping("/testRest")
    public Object testApi1() {
        List<User> list= restTemplate.getForObject("http://eureka-client/getUserList", List.class);
        return list;

    }
}
